﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace MyWpfFramework
{
    public class WindowService 
    {
        //打开登录界面
        public static void OpenWindow()
        {
            var window=new MainWindow();
            window.ShowDialog();
        }
        //隐藏登录界面
        public static void CloseWindow()
        {
           var window=Application.Current.Windows.OfType<Login>().SingleOrDefault(s=>s.IsActive);

            if (window != null)
            { 
                window.Hide();
            }
        }

       
    }
}
